
import time
import logging
LOG_FORMAT = "%(asctime)s - %(filename)s[%(levelname)s]: %(message)s"
logging.basicConfig(level=logging.DEBUG,format=LOG_FORMAT)


def runtime(func):
    print("this is runtime")
    def inner(*args,**kwargs):
        start = time.time()
        result = func(*args,**kwargs) #执行原函数，获取原函数的执行结果
        end= time.time()
        print(f"执行{func.__name__}花了{end - start}s")
        return result #返回原函数的执行结果
    return inner


def logRecor(func):
    print("this is logRecor")
    def inner(*args,**kwargs):
        result = func(*args,**kwargs)
        if result:
            logging.debug(f"执行了{func.__name__}函数，结果为{result}")
            return result
    return inner


@runtime #注释在后的先执行
@logRecor
def add(x,y):
    return x + y

x, y= map(int, input("输入两个待相加的数").split())
print(add(x,y))
